﻿package net.wangit.dev.table;

import net.wangit.LabelUtil;
import net.wangit.MapList;
import net.wangit.context.LocalContext;
import net.wangit.support.MapListFactory;

public class DataTypeMapListFactory implements MapListFactory {

	private static final String I18NFILE = "components";
	private static final String PREFIX = "type.";
	private static final String TYPES[] = { "1", "2", "11", "12", "13", "21",
			"22", "23", "31", "32", "33", "41", "43" };

	public DataTypeMapListFactory() {
	}

	public MapList getMapList() {
		net.wangit.context.ActionContext ac = LocalContext.getLocalContext()
				.getActionContext();
		MapList list = new MapList();
		for (int i = 0; i < TYPES.length; i++) {
			list.put(i, "value", TYPES[i]);
			list.put(i, "name", LabelUtil.get(ac,
					DataTypeMapListFactory.I18NFILE, (new StringBuilder(
							DataTypeMapListFactory.PREFIX)).append(TYPES[i])
							.toString()));
		}

		return list;
	}

}
